<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      lang="zh-cn">
<head>
    <meta content="云之讯,云通讯,云通讯平台" name="keywords"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
    <title>短信云平台运营系统 </title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link th:href="@{/resources/css/bootstrap.min14ed.css?v=3.3.6}" rel="stylesheet">
    <link th:href="@{/resources/css/font-awesome.min93e3.css?v=4.4.0}" rel="stylesheet"><!-- jqgrid-->
    <link th:href="@{/resources/js/plugins/jqgrid/css/ui.jqgrid-bootstrap.css}" rel="stylesheet">
    <link th:href="@{/resources/css/animate.min.css}" rel="stylesheet">
    <link th:href="@{/resources/css/style.min862f.css?v=4.1.0}" rel="stylesheet">
    <link th:href="@{/resources/css/plugins/sweetalert/sweetalert.css}" rel="stylesheet">
    <link th:href="@{/resources/css/doublebox-bootstrap.css}" rel="stylesheet">
    <style>
        /* Additional style to fix warning dialog position */
        #alertmod_table_list_2 {
            top: 900px !important;
        }

        ._green_link {
            color: #008000;
        }

        ._green_link:hover {
            color: #008000;
            text-decoration: underline;
        }

        .modal-content {
            opacity: 1 !important;
            border: none;
        }

        .bootstrap-duallistbox-container label {
            text-align: center;
        }

        .filter {
            text-align: center;
        }

        .demo {
            height: 322px !important;
        }
    </style>
</head>
<body class="gray-bg">
<div th:replace="stat :: statCode"></div>
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabs-container">
                <ul class="nav nav-tabs">
                    <li class="" id="agentTab" th:if="${menus.zkgl}">
                        <a href="/accountInfo/directclient/query">直客管理</a>
                    </li>
                    <li class="active" th:if="${menus.dlszkhgl}">
                        <a data-toggle="tab" href="#tab-2" id="tab-2" aria-expanded="true">子账户管理</a>
                    </li>
                    <li class="" th:if="${menus.khzgl}">
                        <a href="/accountInfo/clientgroup/query" id="tab-3">客户组管理</a>
                    </li>
                </ul>
                <div class="tab-pane active" th:if="${menus.dlszkhgl}">
                    <!-- 搜索条件 -->
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="ibox ">
                                    <div class="ibox-content">
                                    <input type="hidden" th:value="${jsmsMenu.menuId}" id="menuId">
                                    <form role="form" class="form-inline" id="mainForm" method="post">
                                        <div class="form-group">
                                            <!-- <label for="example1" class="sr-only">用户名</label> -->
                                            <input type="text" placeholder="子账户ID/子账户名称/手机号码/销售名字/所属客户ID" id="condition"
                                                   name="condition" class="form-control" style="width:360px">
                                        </div>
                                        <div class="form-group">
                                            <label for="star_level">客户等级:</label>
                                            <select id="star_level" class="form-control" name="star_level">
                                                <option value="">全部</option>
                                                <option value="1">1星</option>
                                                <option value="2">2星</option>
                                                <option value="3">3星</option>
                                                <option value="4">4星</option>
                                                <option value="5">5星</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="status">子账户状态:</label>
                                            <select id="status" class="form-control" name="status">
                                                <option value="">全部</option>
                                                <option value="1" selected="selected">已启用</option>
                                                <option value="5">已冻结</option>
                                                <option value="6">已注销</option>
                                                <option value="7">已锁定</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="agent_type">所属客户类型:</label>
                                            <select id="agent_type" class="form-control" name="agent_type">
                                                <option value="">所有</option>
                                                <option value="1">销售代理商</option>
                                                <option value="2">品牌代理商</option>
                                                <option value="5">OEM代理商</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="paytype">付费类型:</label>
                                            <select id="paytype" class="form-control" name="paytype">
                                                <option value="">所有</option>
                                                <option value="0">预付</option>
                                                <option value="1">后付</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="charge_rule">计费规则:</label>
                                            <select id="charge_rule" class="form-control" name="charge_rule">
                                                <option value="">所有</option>
                                                <option value="0">提交量</option>
                                                <option value="1">成功量</option>
                                                <option value="2">明确成功量</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="extValueID">是否支持子客户:</label>
                                            <select id="extValueID" class="form-control" name="extValue">
                                                <option value="">所有</option>
                                                <option value="1">支持</option>
                                                <option value="0">不支持</option>
                                            </select>
                                        </div>
                                        <!--<div class="form-group">-->
                                        <!--<label for="agent_info" class="sr-only">所属代理商ID</label>-->
                                        <!--<input type="text" placeholder="所属代理商ID" id="agent_info" class="form-control" name="agent_info">-->
                                        <!--</div>-->
                                        <!-- 时间选择 -->
                                        <div class="form-group" id="sandbox-container">
                                            <div class="form-group pull-right"><span
                                                    style="font-weight:700">创建时间:</span>
                                                <input placeholder="起始时间" class="form-control layer-date"
                                                       id="start_time_day" name="start_time_day" style="width:102px;"/>至
                                                <input placeholder="截止时间" class="form-control layer-date"
                                                       id="end_time_day"
                                                       name="end_time_day" style="width:102px;"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                        	<span>&nbsp;&nbsp;<button type="button" class="btn btn-sm btn-danger"
                                                      onclick="search()">搜索</button>
                            </span><a href="javascript:;" class="btn btn-sm btn-primary" onclick="reset()">重置</a></span>
                                            <span>&nbsp;&nbsp;<button type="button" class="btn btn-sm btn-primary hide"
                                                                      data-menuId="6017"
                                                                      onclick="exportExcel()">导出Excel</button></span>
                                        </div>
                                    </form>
                                    </div>
                                    <div class="ibox-content">
                                        <div class="jqGrid_wrapper">
                                            <table id="table_list"></table>
                                            <div id="pager_list"></div>
                                        </div>
                                        <p>&nbsp;</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/resources/js/jquery.min.js?v=2.1.4}"></script>
<script th:src="@{/resources/js/bootstrap.min.js?v=3.3.6}"></script>
<script th:src="@{/resources/js/content.min.js?v=1.0.0}"></script>
<script th:src="@{/resources/js/plugins/layer/laydate/laydate.js}"></script>
<script th:src="@{/resources/js/plugins/peity/jquery.peity.min.js}"></script>
<script th:src="@{/resources/js/plugins/jqgrid/js/i18n/grid.locale-cn.js}"></script>
<script th:src="@{/resources/js/plugins/jqgrid/js/jquery.jqGrid.min.js}"></script>
<script th:src="@{/resources/js/date_format.min.js?v=1.0.0}"></script>
<script th:src="@{/resources/js/plugins/sweetalert/sweetalert.min.js}"></script>
<script th:src="@{/resources/js/common.js?v=1.1.0}"></script>
<script th:src="@{/resources/js/layer/layer.js}"></script>
<script th:src="@{/resources/js/doublebox-bootstrap.js}"></script>

<script th:inline="javascript">
    /*<![CDATA[*/

    var start = {
        elem: "#start_time_day",
        format: "YYYY-MM-DD",
        min: halfYearAgo("yyyy-MM-dd"),
        max: laydate.now(),
        istoday: true,
        choose: function (datas) {
            end.min = datas;
        }
    };
    var end = {
        elem: "#end_time_day",
        format: "YYYY-MM-DD",
        min: halfYearAgo("yyyy-MM-dd"),
        max: laydate.now(),
        istoday: true,
        choose: function (datas) {
            start.max = datas;
        }
    };
    laydate(start);
    laydate(end);

    function reset() {
        $("#mainForm").find("input").val("");
        $("#mainForm").find("select").val("");
    }

    function search() {

        $("#table_list").jqGrid('setGridParam', {
            datatype: 'json',
            postData: {
                condition: $("#condition").val(),
                agent_info: $("#agent_info").val(),
                agent_type: $("#agent_type").val(),
                paytype: $("#paytype").val(),
                charge_rule: $("#charge_rule").val(),
                start_time_day: $("#start_time_day").val(),
                end_time_day: $("#end_time_day").val(),
                extValue: $("#extValueID").val(),
                status: $("#status").val(),
                starLevel: $("#star_level").val()
            }, //发送数据
            page: 1
        }).trigger("reloadGrid"); //重新载入
    }


    $(document).ready(function () {
        $.jgrid.defaults.styleUI = "Bootstrap";
        $("#table_list").jqGrid({
            url: /*[[@{/accountInfo/client/list}]]*/'',
            mtype: 'POST',
            datatype: "json",
            postData: {
                status: $("#status").val()
            },
            jsonReader: {
                root: "list",
                page: "currentPage",
                total: "totalPage",
                records: "totalCount"
            },
            height: 'auto',
            rownumbers: true,
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 20,
            rowList: [10, 20, 30, 50],
//            colNames: ["客户ID", "客户名称", "手机号码", "客户状态", "客户状态(隐藏)", "认证状态", "所属代理商ID", "所属代理商类型", "归属销售", "付费类型","创建时间", "操作"],
            colModel: [
                {label: "子账户ID", name: "clientid", align: "left", sortable: false, width: 80},
                {label: "子账户名称", name: "name", align: "left", sortable: false, width: 150},
                {label: '客户等级', name: "starLevelStr", align: "left", sortable: false},
                {label: "手机号码", name: "mobile", align: "left", sortable: false, width: 120},
                {label: "子账户状态", name: "statusName", align: "left", sortable: false, width: 80},
                {label: "子账户状态(隐藏)", name: "status", align: "left", sortable: false, hidden: true, width: 80},
                {label: "认证状态", name: "oauth_status", align: "left", sortable: false, width: 80},
                {label: "认证标注(隐藏)", name: "flag", align: "left", sortable: false, hidden: true},
                {label: "所属客户ID", name: "agent_id", align: "left", sortable: false, width: 120},
                {label: "所属客户类型", name: "agent_type_name", align: "left", sortable: false, width: 100},
                {label: "归属销售", name: "userRealName", align: "left", sortable: false, width: 120},
                {label: "计费规则", name: "valueStr", align: "left", sortable: false, width: 120},
                {label: "付费类型", name: "paytypeDesc", align: "left", sortable: false, width: 80},
                {label: "是否支持子账户", name: "extValueStr", align: "left", sortable: false, width: 100},
                {
                    label: "普通短信", name: "normalType", align: "left", sortable: false, width: 80,
                    formatter: function (cellvalue, options, rowObject) {
                        if (!(cellvalue)) {
                            return "0条"
                        }
                        var clientid = rowObject.clientid;
                        var agent_type_name = rowObject.agent_type_name;
                        if (agent_type_name == "品牌代理商") {
                            var agent_type = "Br";
                        } else if (agent_type_name == "OEM代理商") {
                            var agent_type = "OEM";
                        }
                        var title = "剩余普通短信";
                        var normalTypeRemind = "<a class='_green_link'  onclick=\"viewOrderRemain('" + title + "','" + clientid + "','" + agent_type + "')\" >" + cellvalue.toFixed(0) + "条</a>";
                        return normalTypeRemind;
                    }
                },
                {
                    label: "国际短信", name: "interType", align: "left", sortable: false, width: 80,
                    formatter: function (cellvalue, options, rowObject) {
                        if (!(cellvalue)) {
                            return "0.0000元"
                        }
                        var clientid = rowObject.clientid;
                        var title = "剩余国际短信";
                        var agent_type_name = rowObject.agent_type_name;
                        if (agent_type_name == "品牌代理商") {
                            var agent_type = "Br";
                        } else if (agent_type_name == "OEM代理商") {
                            var agent_type = "OEM";
                        }
                        var interTypeRemind = "<a class='_green_link'onclick=\"viewOrderRemainIN('" + title + "','" + clientid + "','" + agent_type + "')\" >" + cellvalue.toFixed(4) + "元</a>";
                        return interTypeRemind;
                    }
                },
                {label: "创建时间", name: "createtime", align: "left", sortable: false, width: 160},
                {
                    label: "操作",
                    name: "total",
                    index: "total",
                    align: "left",
                    sortable: false,
                    title: false,
                    width: 400,
                    formatter: function (cellvalue, options, rowObject) {

                        var clientid = rowObject.clientid;
                        var name = rowObject.name;
                        var status = rowObject.status;
//                        var paytypeDesc = rowObject.paytypeDesc;
                        var oauth_status = rowObject.oauth_status;
                        var agent_type_name = rowObject.agent_type_name;
                        var agent_type = rowObject.agent_type;
                        var flag = rowObject.flag;
                        var ext_value = rowObject.ext_value;
                        var paytype = rowObject.paytype;
                        var value = rowObject.value;
                        var agentId = rowObject.agent_id;
                        var switcher = '';
                        //5:冻结 ; 1:解冻; 6:注销
                        switcher = "<button type='button' class='btn btn-link btn-xs hide autoFailReturn' onclick=\"view('" + clientid + "')\"  data-menuId='6005' onmouseenter=\"showAutoFailReturn('" + clientid + "')\" >查看</button>";
                        switcher += "<button type='button' class='btn btn-link btn-xs hide' onclick=\"updateData('" + clientid + "')\" title='编辑' data-menuId='6006'>编辑</button>";
                        switcher += "<button type='button' class='btn btn-link btn-xs hide' onclick=\"chargeRule('" + clientid + "','" + name + "','" + paytype + "')\" title='修改计费' data-menuId='6007'>修改计费</button>";

                        if (agent_type_name != 'OEM代理商' && paytype != 1 && status != 6) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"deposit('" + name + "','" + clientid + "')\" title='短信充值' data-menuId='6014'>短信充值</button>"
                                + "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"balanceAlarm('" + name + "','" + clientid + "')\" title='余额提醒' data-menuId='6014'>余额提醒</button>";
                        }
                        if (agent_type_name == 'OEM代理商' && paytype == 0) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"remind('" + name + "','" + clientid + "')\" title='余额提醒' data-menuId='6014'>余额提醒</button>";
                        }
                        if (agent_type_name == 'OEM代理商' && paytype != 1 && status != 6) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"oemDeposit('" + name + "','" + clientid + "')\" title='短信充值' data-menuId='6015'>短信充值</button>";
                        }
                        if (status != 5 && status != 6) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"updateStatus('" + name + "','" + clientid + "','5')\" title='冻结' data-menuId='6008'>冻结</button>";
                        }
                        if (status == 5) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"updateStatus('" + name + "','" + clientid + "','1')\" title='解冻' data-menuId='6009'>解冻</button>";
                        }
                        if (status != 6) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"updateStatus('" + name + "','" + clientid + "','6')\" title='注销' data-menuId='6010'>注销</button>";
                        }
                        if (oauth_status == '待认证' && flag > 0) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide' onclick=\"Auditing('" + clientid + "')\" title='审核资质' data-menuId='6013'>审核资质</button>";
                        }

                        if ((oauth_status == '待认证' && flag == 0) || (oauth_status == '认证不通过')) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide' onclick=\"uploadAptitude('" + clientid + "')\" title='上传资质' data-menuId='6012'>上传资质</button>";
                        }
                        if (status != 6 && ext_value == 1) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"manageSub('" + name + "','" + clientid + "','6')\" title='管理子账户' data-menuId='6011'>管理子账户</button>";
                        }
                        if (oauth_status == '已认证' && paytype == 0 && (value == 1 || value == 2)) {
                            switcher += "<button type='button' class='btn btn-link btn-xs hide'  onclick=\"returnFail('" + name + "','" + clientid + "','" + agent_type + "')\" title='失败返还' data-menuId='6016'>失败返还</button>";
                        }
                        return switcher;
                    }
                }
            ],
            pager: "#pager_list",
            viewrecords: true,
            hidegrid: false,
            gridComplete: function () {
                var menuId = $("#menuId").val();
                checkMenu(menuId);
            }
        });

        $(window).bind("resize", function () {
            var width = $(".jqGrid_wrapper").width();
            $("#table_list").setGridWidth(width);
        })


        function keyUp(e) {
            var currKey = 0, e = e || event;
            currKey = e.keyCode || e.which || e.charCode;
            var keyName = String.fromCharCode(currKey);
            if (currKey == 13) {
                search();
            }
        }

        document.onkeyup = keyUp;
    });

    //编辑
    function updateData(clientid) {
        var viewUrl = /*[[@{/accountInfo/client/edit}]]*/;
        window.location.href = viewUrl + "?clientId=" + clientid;
    }

    //修改计费
    //修改计费
    function chargeRule(clientid, clientname, paytype) {
        var url = /*[[@{/accountInfo/changeRule}]]*/;
        layer.open({
            type: 2,
            title: "修改【" + clientid + "-" + clientname + "】计费规则",
            closeBtn: 2,
            area: ['770px', '400px'],
            fix: false, //不固定
            content: url + "?clientId=" + clientid + "&paytype=" + paytype
        });
    }

    //短信充值
    function deposit(name, clientid) {
        if (!isSessionValid()) {
            return;
        }
        var url = /*[[@{/finance/order/charge}]]*/'/finance/order/charge';
        layer.open({
            type: 2,
            shadeClose: true,
            title: '<span>为</span><span style="color: #003399;font-weight: 900">' + clientid + '</span><span>-</span><span style="color: #003399;font-weight: 900">' + name + '</span><span>短信充值</span>',
            content: url + "?clientId=" + clientid,
            area: ['1200px', '700px']
        });
    }

    function oemDeposit(name, clientid) {
        if (!isSessionValid()) {
            return;
        }
        var url = /*[[@{/accountInfo/oem/agentpoolsView}]]*/'/finance/order/charge';
        layer.open({
            type: 2,
            shadeClose: true,
            title: '<span>为</span><span style="color: #003399;font-weight: 900">' + clientid + '</span><span>-</span><span style="color: #003399;font-weight: 900">' + name + '</span><span>短信充值</span>',
            content: url + "?clientId=" + clientid,
            area: ['1200px', '700px']
        });
    }

    //oem余额提醒
    function remind(name, id) {
        if (!isSessionValid()) {
            return;
        }
        var url = '/accountInfo/client/balancealarm/view?clientid=' + id + "&name=" + name;
        layer.open({
            type: 2,
            shadeClose: true,
            title: '余额提醒设置',
            content: url,
            area: ['800px', '600px']
        });
    }

    //查看短信详情
    function viewOrderRemain(title, clientid, agent_type) {
        if (!isSessionValid()) {
            return;
        }
        var url = /*[[@{/accountInfo/client/orderRemain}]]*/'/accountInfo/client/orderRemain';
        layer.open({
            type: 2,
            shadeClose: true,
            title: '<span>' + title + '</span>',
            content: url + "?clientId=" + clientid + "&agent_type=" + agent_type,
            area: ['800px', '700px']
        });
    }

    //查看短信详情
    function viewOrderRemainIN(title, clientid, agent_type) {
        if (!isSessionValid()) {
            return;
        }
        var url = /*[[@{/accountInfo/client/orderRemainIN}]]*/'/accountInfo/client/orderRemainIN';
        layer.open({
            type: 2,
            shadeClose: true,
            title: '<span>' + title + '</span>',
            content: url + "?clientId=" + clientid + "&agent_type=" + agent_type,
            area: ['800px', '700px']
        });
    }


    //品牌余额提醒
    function balanceAlarm(name, clientid) {
        if (!isSessionValid()) {
            return;
        }
        var url = /*[[@{/alarm/client/balanceAlarm}]]*/'/alarm/client/balanceAlarm';
        layer.open({
            type: 2,
            shadeClose: true,
            title: '余额提醒设置',
            content: url + "?clientId=" + clientid,
            area: ['768px', '500px']
        });
    }


    function updateStatus(name, clientid, status) {
        var statuName = "冻结";
        switch (status) {
            case "5":
                statuName = "冻结";
                break;
            case "1":
                statuName = "解冻";
                break;
            case "6":
                statuName = "注销";
                break;
        }
        swal({
            title: "您确定要" + statuName + "客户【" + name + "】",
            text: "",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: statuName,
            cancelButtonText: "让我再考虑一下…",
            closeOnConfirm: false
        }, function () {
            $.ajax({
                url: /*[[@{/accountInfo/client/updateStatus}]]*/'',
                type: "POST",
                data: {
                    clientId: clientid,
                    status: status
                },
                success: function (data) {
                    if (data == null) {
                        swal("失败！", "系统错误，请稍后再试！", "error")
                    } else if (data.success == true) {
                        swal("成功！", data.msg, "success")
                    } else {
                        swal("失败！", data.msg, "error")
                    }
                    search();
                }
            });
        });
    }

    var max_export_num = /*[[${max_export_num}]]*/;

    //导出Excel文件
    function exportExcel() {
        var totalCount = $("#table_list").jqGrid('getGridParam', 'records');
        if (totalCount == 0) {
            layer.msg("共0条记录，将不导出Excel文件", {icon: 2});
            return;
        }
        if (totalCount > max_export_num) {
            layer.msg("导出Excel文件条数大于" + max_export_num + "条", {icon: 2});
            return;
        }
        var mainForm = $("#mainForm");
        var action = mainForm.attr("action");
        var exporUrl = /*[[@{/accountInfo/client/exportExcel}]]*/;
        mainForm.attr("action", exporUrl).submit();
        mainForm.attr("action", action);
    }

    function view(clientid) {
        var viewUrl = /*[[@{/accountInfo/client/view}]]*/;
        window.location.href = viewUrl + "?clientId=" + clientid;
    }

    //冒泡显示最近生效日期的记录
    function showAutoFailReturn(clientid) {
        $.ajax({
            url:/*[[@{/accountInfo/getUserProperty}]]*/,
            type: "POST",
            data: {
                clientid: clientid
            },
            success: function (data) {
                if (data != null) {
                    //console.log("触发了事件-->" + data.effectDate+"----"+clientid)
                    $(".autoFailReturn").attr("title", "失败返还最近生效日期为:"+(data.effectDate).substr(0,10));
                }else{
                    layer.msg("没有找到"+clientid+"的最近失败返还记录!");
                }
            }
        });
    }

    function Auditing(clientid) {
        var viewUrl = /*[[@{/opsAudit/customer/view}]]*/;
        window.location.href = viewUrl + "?clientId=" + clientid + "&type=" + 11;
    }

    function uploadAptitude(clientid, agentId) {
        $.ajax({
            url: /*[[@{/accountInfo/client/checkAgentInfo}]]*/'',
            type: "POST",
            data: {
                agentId: agentId
            },
            success: function (data) {
                if (data == null) {
                    layer.msg("您的代理商还未认证", {icon: 2, time: 1500});
                } else if (data.code == 500) {
                    layer.msg("您的代理商还未认证", {icon: 2, time: 1500});
                } else {
                    var url = /*[[@{/accountInfo/qualification/save}]]*/;
                    window.location.href = url + "?clientid=" + clientid;
                }
            }
        });
    }

    function manageSub(name, clientid, status) {
        var url = /*[[@{/accountInfo/subclient/list}]]*/;
        layer.open({
            type: 2,
            shadeClose: true,
            title: '',
            content: [url + "?clientId=" + clientid + '&name=' + name, 'no'],
            area: ['1000px', '700px']
        });


    }

    function returnFail(name, clientid, agentType) {
        var url = /*[[@{/accountInfo/{clientid}/returnFail}]]*/'';
        url = url.replace('{clientid}', clientid);
        window.location.href = url + "?name=" + encodeURI(encodeURI(name)) + "&agentType=" + agentType;
//        layer.open({
//            type: 2,
//            shadeClose: true,
//            title:'',
//            content: [url,'no'],
//            area:['1000px','700px']
//        });
    }

    /*]]>*/
</script>
</body>
</html>